<?php
/*****************************************
Wer Wird Millionär
TIT10NS Webengeneering Projekt

resultnames - Seite um Gewinnstufen zu ändern

Autoren: Markus Schwarz
Copyright: 2012 DHBW Mannheim
*****************************************/
include ("inc/startup.php");
include ("inc/header.php");
require ("inc/TAdminView.php");

if (isset($_POST['submitButton'])) {
	
	$levels = array(
		$_POST["level0"],
		$_POST["level1"],
		$_POST["level2"],
		$_POST["level3"],
		$_POST["level4"],
		$_POST["level5"],
		$_POST["level6"],
		$_POST["level7"],
		$_POST["level8"],
		$_POST["level9"],
		$_POST["level10"],
		$_POST["level11"],
		$_POST["level12"],
		$_POST["level13"],
		$_POST["level14"],
		$_POST["level15"]);
	
	$levelEmpty = false;
	
	foreach($levels as $level) {
		if ($level == "") {
			$levelEmpty = true;
		}
	}
	if ($levelEmpty == false) {
		TModel::setResults($levels);
		$notification = new TAdminNotification ("success", "resultFormSuccess");
	}
	else {
		$notification = new TAdminNotification ("error", "resultFormTextEmpty");
	}
	
	TAdminView::getResultForm($notification, $levels);
}
else {

	$notification = new TAdminNotification ("", "");
	TAdminView::getResultForm($notification);

}

include ("inc/footer.php");
?>